<template>
  <div id='demo'>

    <view-box ref="viewBox" body-padding-top="0px" body-padding-bottom="0px">

      <scroller lock-x height="-50" ref="scrollerBottom">

        <div v-if='pageType!="baoming"' style="position: absolute;top: 0;max-width: 850px;width: 100%;" class='headerWarpper'>
          <x-header slot="header" :left-options="{backText: ''}" style="width:100%;position:fixed;left:0;top:0;z-index:100;" :title="'详情'">
            <a href="./#/racelist" style="font-size:24px" slot="right">
              <i class="fa fa-home fa-fw"></i>
            </a>
          </x-header>
        </div>

        <Myheader v-if='pageType=="baoming"' :page="page"></Myheader>
        <ShowMessage :type='"all"' :userKey="userKey"></ShowMessage>

      </scroller>

    </view-box>
    <myFooter v-if='pageType!="baoming"'></myFooter>

    <div v-if='pageType=="baoming"' class=''>
      <div class="footerBanner">
      </div>
      <div id="tabbar" class='needsclick'>
        <div class="button_header" id='x-bottom'>
          <x-header class="fixBottomButton" slot="header" style="width: 100%;position: fixed;bottom: 0px;z-index: 100;max-width: 850px;margin: 0 auto;" title="立即报名" @on-click-title='popup'>
            <div slot="overwrite-left"></div>
            <!-- <x-icon @click.native="showMenu=true" slot="overwrite-left" type="navicon" size="35" style="fill:#fff;position:relative;top:-8px;left:-3px;"></x-icon> -->

          </x-header>

        </div>
      </div>
    </div>

  </div>
</template>


<script>
/* eslint-disable*/
//axios

//let clock1 = 1
var isMini = false;
//判断环境 是否在小程序
var checkIsFromMiniProgram = function() {
  wx.miniProgram.getEnv(function(res) {
    console.log("minprogram:" + res.miniprogram); // true
    //  alert(JSON.stringify(res));
    if (res.miniprogram === true) {
      isMini = true;
      // alert('isMiniprogram:' + res.miniprogram);
    } else {
      isMini = false;
      // alert("========公众号");
    }
  });
};

// import {
//   AlertPlugin,
//   ToastPlugin,
//   ConfirmPlugin,
//   Actionsheet,
//   XDialog
// } from 'vux'

import qs from "qs";
import { axios } from "@/api/axios.js";
import Myheader from "@/common/components/myheader.vue";
import ShowMessage from "@/common/components/show_message.vue";
import { indexedDB } from "@/api/indexedDB.js";
import mixin from "@/common/js/mixin";
import { dateStringToDateTime, toDecimal2 } from "@/common/js/main.js";
import { sendPay } from "@/api/sendPay.js";
import { cookie } from "vux";

import myFooter from "@/common/components/myfooter.vue";
import {
  Alert,
  XButton,
  CellFormPreview,
  Group,
  Cell,
  ViewBox,
  Card,
  Msg,
  XHeader,
  Scroller,
  TransferDomDirective as TransferDom
} from "vux";
import Index from "./index";

export default {
  mixins: [mixin],
  props: ["page", "host"],
  components: {
    ShowMessage,
    Alert,
    ViewBox,
    XHeader,
    Msg,
    Card,
    CellFormPreview,
    Group,
    Cell,
    XButton,
    Myheader,
    ViewBox,
    myFooter,
    Scroller
  },
  data() {
    return {};
  },
  directives: {
    TransferDom
  },
  created() {
    this.userKey = this.$route.query.userKey || this.$route.query.key;
  },
  mounted() {},
  methods: {
    popup() {
      this.$router.push({
        path: `/list`
      });
      //console.log(this)
      //console.log(this.$refs.pop)
      //this.$refs.pop.$children[0].$el.click();
      //this.$refs.pop.$children[0].$el.click();
    }
  }
};
</script>

<style lang="less" rel="stylesheet/less">
</style>
